import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import get from '@dfeidao/atom-web/local/get';
import set from '@dfeidao/atom-web/local/set';
import render from '@dfeidao/atom-web/render/render';
import p018 from './p018';
export default async function a015(fd: IFeidaoAiBrowserComponent, attr_no: string, attr_name: string) {
	// todo
	const s = get(fd, 'a') as Array<{}>;
	if (attr_no) {
		for (let i = 0; i < s.length; i++) {
			const c = s[i] as { _id: string, productid: string, attr_no: string, attr_name: string, is_stop: number, attr_value: string };
			if (attr_no === c.attr_no) {
				c.attr_value = attr_name;
			}
		}
	}
	set(fd, 's', s);
	render(fd, s, p018, 'p018', 'inner');
}
